Supported ciphers
ProtectToolkit-J includes support for symmetric block ciphers, symmetric stream ciphers, and the asymmetric RSA cipher. The algorithms listed in the table below are available through the javax.crypto.Cipher interface.
Algorithms available through javax.crypto.Cipher
Cipher name | Key length (bits) | Block size (bits) | Cipher modes | Padding |
---|---|---|---|---|
DES | 64 | 64 | ECB,CBC | PKCS5Padding, NoPadding |
DESede | 128,192 | 64 | ECB,CBC | PKCS5Padding, NoPadding |
AES | 128,182,256 | 64 | ECB,CBC | PKCS5Padding, NoPadding |
IDEA | 128 | 64 | ECB,CBC | PKCS5Padding, NoPadding |
CAST128 | 8-128 | 64 | ECB,CBC | PKCS5Padding, NoPadding |
RC2 | 0-1024 | 64 | ECB,CBC | PKCS5Padding, NoPadding |
RC4 | 8-2048 | N/A | ECB | NoPadding |
PBEWithMD2And (PBE Ciphers) | 64 | 64 | N/A | N/A |
PBEWithMD5And (PBE Ciphers) | 64 | 64 | N/A | N/A |
PBEWithMD5AndCAST (PBE Ciphers) | 128 | 128 | N/A | N/A |
PBEWithSHA1AndCAST (PBE Ciphers) | 128 | 128 | N/A | N/A |
PBEWithSHA1AndTriple (PBE Ciphers) | 128 | 128 | N/A | N/A |
RSA | 512-4096 | variable | ECB | PCKS1Padding, NoPadding, OAEP, OAEPPadding |
The preceding table lists the following:
-
Cipher name, which is the name of the cipher as it is known to the JCE. To request a particular algorithm, pass the cipher name to the Cipher.getInstance() method.
-
Key length (bits), which is the key lengths that the algorithms support.
-
Block size (bits), which is the size of data that is processed by the cipher. During encryption, the amount of data processed must be a multiple of this size, unless padding is employed (see below), and the encrypted output will therefore be a multiple of this size.
-
Cipher modes, which is Electronic Codebook Mode (ECB) or Cipher Block Chaining (CBC). ECB and CBC are defined in FIPS PUB 81: DES Modes of Operation. All ciphers default to ECB mode.
-
Padding, which is the applied padding.
PKCS5Padding - the standard padding applied to block ciphers with a block size of 64 bits (PKCS#5 padding, as defined in PKCS#5). DES, DESede, IDEA, CAST128 and RC2 all default to "NoPadding". When PKCS5Padding is employed with a block cipher, the input data for encryption can be any length and will be padded to the appropriate length before encryption.
PCKS1Padding - the standard padding mechanism for the RSA cipher (PKCS#1 padding, as defined in PKCS#1). When this padding mechanism is used, PKCS#1 padding will be performed on each block encrypted. For public-key encryption, PKCS#1 type 1 blocks will be created, while for private-key encryption, type 2 blocks will be created.
NoPadding - no PKCS#1 padding is applied to the data and the processing is performed as per the X.509 (raw) RSA specification.
Note
ProtectToolkit-J does not support algorithm parameters; calls to Cipher.getParameters() will always return null
. Neither does the provider include any java.security.AlgorithmParameters classes.